package com.hzit.order.service.impl;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.hzit.order.config.AlipayTemplate;
import com.hzit.order.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Service
public class PayServiceImpl implements PayService {

	@Autowired
	private AlipayTemplate alipayTemplate;
	/**
	 * 1. 生成支付页面
	 * @param outTradeNo
	 * @param money
	 * @return
	 */
	@Override
	public String createPayPage(String outTradeNo, Long money) throws AlipayApiException {
		//获得初始化的AlipayClient
		return alipayTemplate.createPayPage(outTradeNo,money);
	}
}
